import request from "@/utils/request";
import { put } from "node_modules/axios/index.d.cts";

// 获取分页数据
export const getPage = (queryParams: any) => {
    return request({
        url: "/api/v1/roles/page",
        method: "get",
        params: queryParams
    })
}

// 添加
export const addPage = (data: any) => {
    return request({
        url: "/api/v1/roles",
        method: "post",
        data: data,
    })
}


// 获取回显数据
export const getBack = (id: number) => {
    return request({
        url: "/api/v1/roles/" + id + "/form",
        method: "get"
    })
}

// 修改数据
export const updateList = (id: any, data: any) => {
    return request({
        url: "/api/v1/roles/" + id,
        method: "put",
        data: data,
    });
}

// 删除
export const delList = (ids: any) => {
    return request({
        url: "/api/v1/roles/" + ids,
        method: "delete"
    })
}